<template>
<div>
  <table>
    <tr>
      <td>名称</td>
      <td>图片</td>
      <td>课程</td>
      <td>操作</td>
    </tr>
    <tr v-for="i in clist">
      <td>{{i.name}}</td>
      <td>

        <van-image
          width="5rem"
          height="5rem"
          fit="contain"
          :src="i.pic"
        />
      </td>
      <td>{{i.title}}</td>
      <td>
        <router-link :to="{path:'kec',query:{'id':i.id}}">查看</router-link>
      </td>

    </tr>
  </table>
  <cpage :total="total" :page_size='page_size' @ye="fenye"/>
</div>
</template>

<script>
import cpage from "./cpage";

export default {
  name: "pageM",
  data(){
    return{
      clist:[],
      cpage:1,
      total:10,
      page_size:2
    }
  },
  components:{
   'cpage':cpage
  },
  methods:{

    get_cpage(){
      this.$axios.get('users/pageM?cpage='+this.cpage).then(res=>{
        this.clist = res.data.list
        this.total = res.data.total
      })
    },
    fenye(p){
      this.cpage = p
      this.get_cpage()
    }
  },
  mounted() {
    this.get_cpage()

  }
}
</script>

<style scoped>

</style>
